-- get_run_tree_data
--
local import = import
---@type behavior_ret
local bret = import('bt/bt_plugin/behavior3/behavior_ret')
---@type TREE_TYPE_CONFIG
local TREE_TYPE_CONFIG = import('bt/custom_node/enum_type_cfg/TREE_TYPE_CONFIG')
local RUN_TREE_DATA_KEY = TREE_TYPE_CONFIG.RUN_TREE_DATA_KEY
local M = {
    name = "get_run_tree_data",
    type = "Action",
    desc = "获得运行树节点传入的数据",
    args = {
        --{ "str", "string", "变量描述" }
    },
    output = { "run_tree_data" }
}

function M.run(node, env, value)
    local runTreeData = env[RUN_TREE_DATA_KEY]
    if runTreeData then
        return bret.SUCCESS, runTreeData.data
    end
    return bret.FAIL
end

return M
